#include <iostream>

#include "range.h"

using namespace std;

int main() {
	Range range(1, 10);

	cout << "The range: " << range << endl;

	cout << "Iterating: " << endl;
	for (RangeIterator iter = range.begin(); iter != range.end(); ++iter)
		cout << iter << ": " << *iter << endl;
	cout << endl;

	range = Range(23, 44, 5);

	cout << "The range: " << range << endl;

	cout << "Iterating: " << endl;
	for (RangeIterator iter = range.begin(); iter != range.end(); ++iter)
		cout << iter << ": " << *iter << endl;
	cout << endl;

	RangeIterator iter2 = range.end();
	try {
		cout << *iter2;
	} catch (RangeIteratorException e) {
		cout << e << endl;
	}

	try {
		cout << ++iter2;
	} catch (RangeIteratorException e) {
		cout << e << endl;
	}
	return 0;
}
